﻿
using GameProtocol.Common;
using GameProtocol.Protocol;
using NetCommon;
using ServerFrame;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RPGGameServer.Tools
{
    /// <summary>
    /// UserToken 发送消息扩展
    /// </summary>
    public static class ExUserToken
    {
        //没办法确定模块，就调用此方法（默认为公共模块）
        public static void Send(this UserToken token, ErrorCode errorCode)
        {
            Send(token, Protocal.Common, CommonProtocol.S2C_ErrorCode, errorCode);
        }
        //有确认模块调用此方法
        public static void Send(this UserToken token, Protocal type, short command, object msg = null)
        {
            NetModel model = new NetModel();
            model.protocal = type;
            model.commond = command;
            model.message = msg;
            token.SendNetModel(model);
        }
    }
}
